package com.md04.service;

import com.md04.entity.Dept;
import com.md04.mapper.DeptMapper;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Data

public class DeptServiceImpl implements DeptService {
    @Autowired
    private DeptMapper deptMapper;//接口

    @Override
    public List<Dept> selectAllDept() {

        return deptMapper.selectAllDept();
    }

    @Override

    public Dept selectOneById(int id) {
        return deptMapper.selectOneById(id);
    }

    @Override

    public Boolean deleteById(int id) {
        return deptMapper.deleteById(id) > 0;
    }

    @Override

    public void addOne(Dept dept) {
        deptMapper.addOne(dept);
    }

    @Override

    public void updateOne(Dept dept) {
        deptMapper.updateOne(dept);
    }
}
